package com.example.userserver.controller;

import com.example.common.result.R;
import com.example.userserver.service.IUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author benjamin_5
 * @Description
 * @date 2023/2/22
 */
@RestController
@RequestMapping("auth")
@AllArgsConstructor
public class AuthController {

    private final IUserService userService;

    @PostMapping("/token/get")
    public R getToken(@RequestParam("userName") String userName,@RequestParam("password") String password){
        // 没有做非空校验，为什么？
        return userService.getToken(userName, password);
    }

}
